var Base = {
    /**
     * 发送Ajax
     * @param {type} arg0 url
     * @param {type} arg1 data
     * @param {type} arg2 type
     * @param {type} arg3 dataType
     * @param {type} arg4 func
     * @returns {undefined}
     */
    sendAjax: function (arg0, arg1, arg2, arg3, arg4) {
        var lens = arguments.length,
                $S = {
                    url: arg0,
                    data: typeof (arg1) == 'function' ? {} : arg1,
                    type: typeof (arg2) == 'function' ? "GET" : arg2,
                    dataType: typeof (arg3) == 'function' ? "json" : arg3
                };
        $.ajax({
            type: $S.type,
            url: $S.url,
            data: $S.data,
            dataType: $S.dataType,
            success: function ($D) {
                switch (lens) {
                    case 2:
                        typeof (arg1) == 'function' && arg1($D);
                        break;
                    case 3:
                        typeof (arg2) == 'function' && arg2($D);
                        break;
                    case 4:
                        typeof (arg3) == 'function' && arg3($D);
                        break;
                    case 5:
                        typeof (arg4) == 'function' && arg4($D);
                        break;
                }
            }
        });
    }
};

$(function () {
    if(jQuery.isFunction($('.pageNav').pagination)){ 
        $('.pageNav').pagination({
            current: parseInt($('input[name=currentPage]').val()),
            totalData: parseInt($('input[name=totalData]').val()),
            showData: parseInt($('input[name=showData]').val()),
            jumpUrlBase: $('input[name=jumpUrlBase]').val(),
            callback: function (api) {
                $('.now').text(api.getCurrent());
            }
        }, function (api) {
            $('.now').text(api.getCurrent());
        });
    }
});